/**
 * 
 */
package gmu.drr.entity.netFactory;

import java.util.ArrayList;
import java.util.Properties;

import gmu.drr.entity.*;
import gmu.drr.modelInst.simple.ModelSimple;

/**
 * @author rothmd01
 *
 */
public abstract class ModelFactory {

	private static ModelFactory inst = null;
	
	public static ModelFactory getInstance() { 
		// SUBCLASS MUST OVERRIDE
		/*if( inst == null ) {
			inst = new ModelFactory();
		}*/ 
		return inst;
	}
	
	protected ModelModel model;
	protected Properties props;
	
	protected ArrayList<User> buildUsers( final int numUsers ) {
		ArrayList<User> retVal = null;
		assert model != null;
		retVal = new ArrayList<User>(numUsers);
		for( int i = 0; i < numUsers; i++ ) {
			User user;
			user = new User();
			user.setUserNo(i);
			retVal.add(user);
		}
		model.setUserList(retVal);
		return retVal;
	}
	
	protected ArrayList<Doc> buildDocs( final int numDocs ) {
		ArrayList<Doc> retVal = null;
		assert model != null;
		retVal = new ArrayList<Doc>( numDocs );
		for( int i = 0; i < numDocs; i++ ) {
			Doc doc;
			doc = new Doc();
			doc.setDocNo(i);
			retVal.add(doc);
		}
		model.setDocList(retVal);
		return retVal;
	}
	public abstract ModelModel buildModel();

	protected ModelFactory() {
	}
}
